function PlotSelectedTfcLines()

%% Set up..
Files = GetFiles(); Colors = GetColors(); LineStyles = GetLineStyles(); Freq = GetFrequencyBins();
channels = {'OCCV', 'OCCD', 'IPSI', 'IPSS', 'FROP', 'PARA', 'PARO', 'TEMI', 'TEMM', 'TEMS'};
% channels = {'OCCV', 'OCCD', 'IPSI', 'IPSS'};
xlimGeneral = [-2500 2500];
ylimGeneral = [0.91 1.19];

% Plotset1(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% Plotset2(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% Plotset3(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% Plotset4(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% Plotset5(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% Plotset6(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
Plotset7(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% Plotset8(Files, Colors, LineStyles, Freq, channels, xlimGeneral, [0.55 1.4]);
% Plotset9(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
% PlotsetTest(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral);
end

function Plotset1(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Loop over channels (Plotset 1)
figures = [];
for chI = 1:length(channels)
    channel = channels{chI};
    fnFreq = fieldnames(Freq);
    for frI = 1:length(fnFreq)
        selectedFreq = Freq.(fnFreq{frI});
        figures(end+1) = figure(); ax = gca; hold('on');
        PlotSingleLine(ax, Files.Joined_FHAmbFResp, channel, selectedFreq, Colors.Red, LineStyles.Solid, 3);
        PlotSingleLine(ax, Files.Joined_FHAmbHResp, channel, selectedFreq, Colors.Green, LineStyles.Solid, 3);
        PlotSingleLine(ax, Files.Joined_SphAmbResp, channel, selectedFreq, Colors.Blue, LineStyles.Solid, 3);
        PlotSingleLine(ax, Files.Joined_FHUnambFResp, channel, selectedFreq, Colors.Red, LineStyles.Dashed, 3);
        PlotSingleLine(ax, Files.Joined_FHUnambHResp, channel, selectedFreq, Colors.Green, LineStyles.Dashed, 3);
        PlotSingleLine(ax, Files.Joined_SphUnambResp, channel, selectedFreq, Colors.Blue, LineStyles.Dashed, 3);
        title(fnFreq{frI}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
    end
end
SaveAndCloseFigures(figures);
end

function Plotset2(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Stimulus (Plotset 2)
figures = [];
%% Figure for Alpha
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{1}, Freq.Alpha, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{1}, Freq.Alpha, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{1}, Freq.Alpha, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{2}, Freq.Alpha, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{2}, Freq.Alpha, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{2}, Freq.Alpha, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{3}, Freq.Alpha, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{3}, Freq.Alpha, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{3}, Freq.Alpha, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{4}, Freq.Alpha, Colors.Red, LineStyles.DashDot, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{4}, Freq.Alpha, Colors.Green, LineStyles.DashDot, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{4}, Freq.Alpha, Colors.Blue, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for HighGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{1}, Freq.HighGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{1}, Freq.HighGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{1}, Freq.HighGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{2}, Freq.HighGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{2}, Freq.HighGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{2}, Freq.HighGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{3}, Freq.HighGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{3}, Freq.HighGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{3}, Freq.HighGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{4}, Freq.HighGamma, Colors.Red, LineStyles.DashDot, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{4}, Freq.HighGamma, Colors.Green, LineStyles.DashDot, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{4}, Freq.HighGamma, Colors.Blue, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
SaveAndCloseFigures(figures);
end

function Plotset3(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Stimulus again, split up into multiple figures (Plotset 3)
figures = [];
%% Figure for Alpha
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{1}, Freq.Alpha, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{2}, Freq.Alpha, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{3}, Freq.Alpha, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{4}, Freq.Alpha, Colors.Red, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{1}, Freq.Alpha, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{2}, Freq.Alpha, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{3}, Freq.Alpha, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{4}, Freq.Alpha, Colors.Green, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{1}, Freq.Alpha, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{2}, Freq.Alpha, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{3}, Freq.Alpha, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{4}, Freq.Alpha, Colors.Blue, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for LowGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{1}, Freq.LowGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{2}, Freq.LowGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{3}, Freq.LowGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{4}, Freq.LowGamma, Colors.Red, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{1}, Freq.LowGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{2}, Freq.LowGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{3}, Freq.LowGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{4}, Freq.LowGamma, Colors.Green, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{1}, Freq.LowGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{2}, Freq.LowGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{3}, Freq.LowGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{4}, Freq.LowGamma, Colors.Blue, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for HighGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{1}, Freq.HighGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{2}, Freq.HighGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{3}, Freq.HighGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFStim, channels{4}, Freq.HighGamma, Colors.Red, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{1}, Freq.HighGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{2}, Freq.HighGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{3}, Freq.HighGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHStim, channels{4}, Freq.HighGamma, Colors.Green, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{1}, Freq.HighGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{2}, Freq.HighGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{3}, Freq.HighGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambStim, channels{4}, Freq.HighGamma, Colors.Blue, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
SaveAndCloseFigures(figures);
end

function Plotset4(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Same for unambresp. (Plotset 4)
figures = [];
%% Figure for Alpha
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{1}, Freq.Alpha, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{2}, Freq.Alpha, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{3}, Freq.Alpha, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{4}, Freq.Alpha, Colors.Red, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{1}, Freq.Alpha, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{2}, Freq.Alpha, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{3}, Freq.Alpha, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{4}, Freq.Alpha, Colors.Green, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{1}, Freq.Alpha, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{2}, Freq.Alpha, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{3}, Freq.Alpha, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{4}, Freq.Alpha, Colors.Blue, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for LowGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{1}, Freq.LowGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{2}, Freq.LowGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{3}, Freq.LowGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{4}, Freq.LowGamma, Colors.Red, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{1}, Freq.LowGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{2}, Freq.LowGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{3}, Freq.LowGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{4}, Freq.LowGamma, Colors.Green, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{1}, Freq.LowGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{2}, Freq.LowGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{3}, Freq.LowGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{4}, Freq.LowGamma, Colors.Blue, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for HighGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{1}, Freq.HighGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{2}, Freq.HighGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{3}, Freq.HighGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambFResp, channels{4}, Freq.HighGamma, Colors.Red, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{1}, Freq.HighGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{2}, Freq.HighGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{3}, Freq.HighGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHUnambHResp, channels{4}, Freq.HighGamma, Colors.Green, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{1}, Freq.HighGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{2}, Freq.HighGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{3}, Freq.HighGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphUnambResp, channels{4}, Freq.HighGamma, Colors.Blue, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
SaveAndCloseFigures(figures);
end

function Plotset5(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Same for amb.resp. (Plotset 5)
figures = [];
%% Figure for Alpha
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{1}, Freq.Alpha, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{2}, Freq.Alpha, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{3}, Freq.Alpha, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{4}, Freq.Alpha, Colors.Red, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{1}, Freq.Alpha, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{2}, Freq.Alpha, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{3}, Freq.Alpha, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{4}, Freq.Alpha, Colors.Green, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{1}, Freq.Alpha, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{2}, Freq.Alpha, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{3}, Freq.Alpha, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{4}, Freq.Alpha, Colors.Blue, LineStyles.DashDot, 3);
title('Alpha'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for LowGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{1}, Freq.LowGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{2}, Freq.LowGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{3}, Freq.LowGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{4}, Freq.LowGamma, Colors.Red, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{1}, Freq.LowGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{2}, Freq.LowGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{3}, Freq.LowGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{4}, Freq.LowGamma, Colors.Green, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{1}, Freq.LowGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{2}, Freq.LowGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{3}, Freq.LowGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{4}, Freq.LowGamma, Colors.Blue, LineStyles.DashDot, 3);
title('Low Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
%% Figure for HighGamma
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{1}, Freq.HighGamma, Colors.Red, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{2}, Freq.HighGamma, Colors.Red, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{3}, Freq.HighGamma, Colors.Red, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHAmbFResp, channels{4}, Freq.HighGamma, Colors.Red, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{1}, Freq.HighGamma, Colors.Green, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{2}, Freq.HighGamma, Colors.Green, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{3}, Freq.HighGamma, Colors.Green, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_FHAmbHResp, channels{4}, Freq.HighGamma, Colors.Green, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
figures(end+1) = figure(); ax = gca; hold('on');
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{1}, Freq.HighGamma, Colors.Blue, LineStyles.Solid, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{2}, Freq.HighGamma, Colors.Blue, LineStyles.Dashed, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{3}, Freq.HighGamma, Colors.Blue, LineStyles.Dotted, 3);
PlotSingleLine(ax, Files.Joined_SphAmbResp, channels{4}, Freq.HighGamma, Colors.Blue, LineStyles.DashDot, 3);
title('High Gamma'); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
SaveAndCloseFigures(figures);
end

function Plotset6(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Comparisonplot to see the participation of subject FG and RV in the total
% joined set
figures = [];
% Compare all freqbands for H Unamb Resp for all subjects
freqs = fieldnames(Freq)
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambHResp, 'IPSI', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambHResp, 'IPSI', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambHResp, 'IPSI', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'IPSI', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'IPSI', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambHResp, 'IPSI', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(freqs{f}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphAmbResp, 'IPSI', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphAmbResp, 'IPSI', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'IPSI', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegFG_SphAmbResp, 'IPSI', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphAmbResp, 'IPSI', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphAmbResp, 'IPSI', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(freqs{f}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambFResp, 'IPSI', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambFResp, 'IPSI', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambFResp, 'IPSI', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'IPSI', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'IPSI', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFResp, 'IPSI', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(freqs{f}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
SaveAndCloseFigures(figures);
end

function Plotset7(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
figures = [];
freqs = {'Alpha', 'HighGamma'};
cond = {{Files.Joined_FHAmbResp, Files.Joined_FHUnambResp, Files.Joined_FHUnambStim}, ...
    {Files.Joined_FHAmbFResp, Files.Joined_FHUnambFResp, Files.Joined_FHUnambFStim}, ...
    {Files.Joined_FHAmbHResp, Files.Joined_FHUnambHResp, Files.Joined_FHUnambHStim}, ...
    {Files.Joined_SphAmbResp, Files.Joined_SphUnambResp, Files.Joined_SphUnambStim} };
condstls = {{LineStyles.Solid, LineStyles.Dashed, LineStyles.Dotted}, ...
    {LineStyles.Solid, LineStyles.Dashed, LineStyles.Dotted}, ...
    {LineStyles.Solid, LineStyles.Dashed, LineStyles.Dotted}, ...
    {LineStyles.Solid, LineStyles.Dashed, LineStyles.Dotted} };
chanset = { {'OCC','IPSS'}, ...
    {'OCC','IPS'}, ...
    {'m1OCCV','m1OCCD','m1IPSS'}, ...
    {'m1Motor','m1TEM'} };
chancols = { {Colors.Magenta, Colors.Cyan}, ...
    {Colors.Magenta, Colors.Cyan}, ...
    {Colors.Magenta, Colors.Cyan, Colors.Yellow}, ...
    {Colors.Magenta, Colors.Cyan} };
for cs = 1:length(chanset)
    for f = 1:length(freqs)
        for c = 1:length(cond)
            % Do one with each cond{?}{?}
            for cc = 1:length(cond{c})
                figures(end+1) = figure(); ax = gca; hold('on');
                for css = 1:length(chanset{cs})
                    PlotSingleLine(ax, cond{c}{cc}, chanset{cs}{css}, Freq.(freqs{f}), chancols{cs}{css}, condstls{c}{cc}, 3);
                end
                title(freqs{f}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
            end
            % Do one with all cond{?}
            figures(end+1) = figure(); ax = gca; hold('on');
            for cc = 1:length(cond{c})
                for css = 1:length(chanset{cs})
                    PlotSingleLine(ax, cond{c}{cc}, chanset{cs}{css}, Freq.(freqs{f}), chancols{cs}{css}, condstls{c}{cc}, 3);
                end
            end
            title(freqs{f}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
            SaveAndCloseFigures(figures); figures = [];
        end
    end
end
end

function Plotset8(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Compare Motor activity per subject
figures = [];
freqs = {'Alpha', 'HighGamma'};
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHAmbHResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHAmbHResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHAmbHResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHAmbHResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHAmbFResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHAmbFResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHAmbFResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambHStim, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambHStim, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambHStim, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambHStim, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambFStim, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambFStim, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambFStim, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFStim, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end

for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_SphUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphUnambResp, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'm1Motor', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_SphUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphUnambStim, 'm1Motor', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['Motor ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
SaveAndCloseFigures(figures);
end

function Plotset9(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
% Compare Motor activity per subject
figures = [];
freqs = {'Alpha', 'HighGamma'};
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHAmbHResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHAmbHResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHAmbHResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHAmbHResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHAmbFResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHAmbFResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHAmbFResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambHStim, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambHStim, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambHStim, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegFG_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    % PlotSingleLine(ax, Files.RegJF_FHUnambHResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambHStim, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambFStim, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambFStim, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambFStim, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambFResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambFStim, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_FHUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_FHUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDS_FHUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegJF_FHUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_FHUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end

for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_SphUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphUnambResp, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.RegCW_SphUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegDJ_SphUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegDS_SphAmbResp, 'm1TEM', Freq.(freqs{f}), Colors.Cyan, LineStyles.Solid, 3);
%     PlotSingleLine(ax, Files.RegFG_SphUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Red, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegJF_SphUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Green, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.RegRV_SphUnambStim, 'm1TEM', Freq.(freqs{f}), Colors.Blue, LineStyles.Solid, 3);
    title(['m1TEM ' freqs{f}]); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
SaveAndCloseFigures(figures);
end

function PlotsetTest(Files, Colors, LineStyles, Freq, channels, xlimGeneral, ylimGeneral)
figures = [];
freqs = {'Alpha', 'HighGamma'};
for f = 1:length(freqs)
    figures(end+1) = figure(); ax = gca; hold('on');
    PlotSingleLine(ax, Files.Joined_FHUnambHResp, 'OCC', Freq.(freqs{f}), Colors.Yellow, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.Joined_FHAmbHResp, 'OCC', Freq.(freqs{f}), Colors.Magenta, LineStyles.Solid, 3);
    PlotSingleLine(ax, Files.Joined_FHUnambHResp, 'OCCV', Freq.(freqs{f}), Colors.Yellow, LineStyles.Dashed, 3);
    PlotSingleLine(ax, Files.Joined_FHAmbHResp, 'OCCV', Freq.(freqs{f}), Colors.Magenta, LineStyles.Dashed, 3);
    PlotSingleLine(ax, Files.Joined_FHUnambHResp, 'OCCD', Freq.(freqs{f}), Colors.Yellow, LineStyles.DashDot, 3);
    PlotSingleLine(ax, Files.Joined_FHAmbHResp, 'OCCD', Freq.(freqs{f}), Colors.Magenta, LineStyles.DashDot, 3);
    title(freqs{f}); grid(ax, 'on'); xlim(ax, xlimGeneral); ylim(ax, ylimGeneral); legend(ax, 'show', 'Location', 'NorthOutside');
end
SaveAndCloseFigures(figures);
end



function SaveAndCloseFigures(figures)
saveMultipleFigures(figures, [], true);
for fI = 1:length(figures), close(figures(fI)), end;
end


function [hObject legendentry] = PlotSingleLine(ax, filename, channel, freqbinNr, color, linestyle, linewidth)
load(filename)
subject = tfc.subject;
epochdescription = tfc.epochs;
freqbindescription = tfc.freqbindescriptions{freqbinNr};
legendentry = [subject ' ' channel ' - ' epochdescription ' - ' freqbindescription];
legendentry(find(legendentry=='_')) =  '-';
data = tfc.data.(channel)(freqbinNr);
LINE = plot(tfc.times, data.mean, 'Color', color, 'LineStyle', linestyle, 'LineWidth', linewidth);
set(LINE, 'DisplayName', legendentry);
% hAnnotation = get(hobj,'Annotation');
% hLegendEntry = get(hAnnotation','LegendInformation');
% set(hLegendEntry,'IconDisplayStyle','off')
end


function Files = GetFiles()
% Files.Joined_FHAmbResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Ambiguous Response Tfc.mat';
% Files.Joined_FHAmbFResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Ambiguous Face Response Tfc.mat';
% Files.Joined_FHAmbHResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Ambiguous House Response Tfc.mat';
% Files.Joined_FHUnambResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Unambiguous Response Tfc.mat';
% Files.Joined_FHUnambFResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Unambiguous Face Response Tfc.mat';
% Files.Joined_FHUnambHResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Unambiguous House Response Tfc.mat';
% Files.Joined_FHUnambStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Unambiguous Stimulus Tfc.mat';
% Files.Joined_FHUnambFStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Unambiguous Face Stimulus Tfc.mat';
% Files.Joined_FHUnambHStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV FaceHouse Unambiguous House Stimulus Tfc.mat';
% Files.Joined_SphAmbResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV Sphere Ambiguous Response Tfc.mat';
% Files.Joined_SphUnambResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV Sphere Unambiguous Response Tfc.mat';
% Files.Joined_SphUnambStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF_RV Sphere Unambiguous Stimulus Tfc.mat';

Files.Joined_FHAmbResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Ambiguous Response Tfc.mat';
Files.Joined_FHAmbFResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Ambiguous Face Response Tfc.mat';
Files.Joined_FHAmbHResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Ambiguous House Response Tfc.mat';
Files.Joined_FHUnambResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Unambiguous Response Tfc.mat';
Files.Joined_FHUnambFResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Unambiguous Face Response Tfc.mat';
Files.Joined_FHUnambHResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Unambiguous House Response Tfc.mat';
Files.Joined_FHUnambStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Unambiguous Stimulus Tfc.mat';
Files.Joined_FHUnambFStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Unambiguous Face Stimulus Tfc.mat';
Files.Joined_FHUnambHStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF FaceHouse Unambiguous House Stimulus Tfc.mat';
Files.Joined_SphAmbResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF Sphere Ambiguous Response Tfc.mat';
Files.Joined_SphUnambResp = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF Sphere Unambiguous Response Tfc.mat';
Files.Joined_SphUnambStim = 'D:\ECoG\Data\ByRegion\Timefreq\Joined_CW_DJ_DS_JF Sphere Unambiguous Stimulus Tfc.mat';

%Other files
folderByRegion = 'D:\ECoG\Data\ByRegion\Timefreq\';
subject = 'RegCW';
Files.RegCW_FHAmbResp = [folderByRegion subject ' FaceHouse Ambiguous Response Tfc.mat'];
Files.RegCW_FHAmbFResp = [folderByRegion subject ' FaceHouse Ambiguous Face Response Tfc.mat'];
Files.RegCW_FHAmbHResp = [folderByRegion subject ' FaceHouse Ambiguous House Response Tfc.mat'];
Files.RegCW_FHUnambResp = [folderByRegion subject ' FaceHouse Unambiguous Response Tfc.mat'];
Files.RegCW_FHUnambFResp = [folderByRegion subject ' FaceHouse Unambiguous Face Response Tfc.mat'];
Files.RegCW_FHUnambHResp = [folderByRegion subject ' FaceHouse Unambiguous House Response Tfc.mat'];
Files.RegCW_FHUnambStim = [folderByRegion subject ' FaceHouse Unambiguous Stimulus Tfc.mat'];
Files.RegCW_FHUnambFStim = [folderByRegion subject ' FaceHouse Unambiguous Face Stimulus Tfc.mat'];
Files.RegCW_FHUnambHStim = [folderByRegion subject ' FaceHouse Unambiguous House Stimulus Tfc.mat'];
Files.RegCW_SphAmbResp = [folderByRegion subject ' Sphere Ambiguous Response Tfc.mat'];
Files.RegCW_SphUnambResp = [folderByRegion subject ' Sphere Unambiguous Response Tfc.mat'];
Files.RegCW_SphUnambStim = [folderByRegion subject ' Sphere Unambiguous Stimulus Tfc.mat'];
subject = 'RegDJ';
Files.RegDJ_FHAmbResp = [folderByRegion subject ' FaceHouse Ambiguous Response Tfc.mat'];
Files.RegDJ_FHAmbFResp = [folderByRegion subject ' FaceHouse Ambiguous Face Response Tfc.mat'];
Files.RegDJ_FHAmbHResp = [folderByRegion subject ' FaceHouse Ambiguous House Response Tfc.mat'];
Files.RegDJ_FHUnambResp = [folderByRegion subject ' FaceHouse Unambiguous Response Tfc.mat'];
Files.RegDJ_FHUnambFResp = [folderByRegion subject ' FaceHouse Unambiguous Face Response Tfc.mat'];
Files.RegDJ_FHUnambHResp = [folderByRegion subject ' FaceHouse Unambiguous House Response Tfc.mat'];
Files.RegDJ_FHUnambStim = [folderByRegion subject ' FaceHouse Unambiguous Stimulus Tfc.mat'];
Files.RegDJ_FHUnambFStim = [folderByRegion subject ' FaceHouse Unambiguous Face Stimulus Tfc.mat'];
Files.RegDJ_FHUnambHStim = [folderByRegion subject ' FaceHouse Unambiguous House Stimulus Tfc.mat'];
Files.RegDJ_SphAmbResp = [folderByRegion subject ' Sphere Ambiguous Response Tfc.mat'];
Files.RegDJ_SphUnambResp = [folderByRegion subject ' Sphere Unambiguous Response Tfc.mat'];
Files.RegDJ_SphUnambStim = [folderByRegion subject ' Sphere Unambiguous Stimulus Tfc.mat'];
subject = 'RegDS';
Files.RegDS_FHAmbResp = [folderByRegion subject ' FaceHouse Ambiguous Response Tfc.mat'];
Files.RegDS_FHAmbFResp = [folderByRegion subject ' FaceHouse Ambiguous Face Response Tfc.mat'];
Files.RegDS_FHAmbHResp = [folderByRegion subject ' FaceHouse Ambiguous House Response Tfc.mat'];
Files.RegDS_FHUnambResp = [folderByRegion subject ' FaceHouse Unambiguous Response Tfc.mat'];
Files.RegDS_FHUnambFResp = [folderByRegion subject ' FaceHouse Unambiguous Face Response Tfc.mat'];
Files.RegDS_FHUnambHResp = [folderByRegion subject ' FaceHouse Unambiguous House Response Tfc.mat'];
Files.RegDS_FHUnambStim = [folderByRegion subject ' FaceHouse Unambiguous Stimulus Tfc.mat'];
Files.RegDS_FHUnambFStim = [folderByRegion subject ' FaceHouse Unambiguous Face Stimulus Tfc.mat'];
Files.RegDS_FHUnambHStim = [folderByRegion subject ' FaceHouse Unambiguous House Stimulus Tfc.mat'];
Files.RegDS_SphAmbResp = [folderByRegion subject ' Sphere Ambiguous Response Tfc.mat'];
Files.RegDS_SphUnambResp = [folderByRegion subject ' Sphere Unambiguous Response Tfc.mat'];
Files.RegDS_SphUnambStim = [folderByRegion subject ' Sphere Unambiguous Stimulus Tfc.mat'];
subject = 'RegFG';
Files.RegFG_FHAmbResp = [folderByRegion subject ' FaceHouse Ambiguous Response Tfc.mat'];
Files.RegFG_FHAmbFResp = [folderByRegion subject ' FaceHouse Ambiguous Face Response Tfc.mat'];
Files.RegFG_FHAmbHResp = [folderByRegion subject ' FaceHouse Ambiguous House Response Tfc.mat'];
Files.RegFG_FHUnambResp = [folderByRegion subject ' FaceHouse Unambiguous Response Tfc.mat'];
Files.RegFG_FHUnambFResp = [folderByRegion subject ' FaceHouse Unambiguous Face Response Tfc.mat'];
Files.RegFG_FHUnambHResp = [folderByRegion subject ' FaceHouse Unambiguous House Response Tfc.mat'];
Files.RegFG_FHUnambStim = [folderByRegion subject ' FaceHouse Unambiguous Stimulus Tfc.mat'];
Files.RegFG_FHUnambFStim = [folderByRegion subject ' FaceHouse Unambiguous Face Stimulus Tfc.mat'];
Files.RegFG_FHUnambHStim = [folderByRegion subject ' FaceHouse Unambiguous House Stimulus Tfc.mat'];
Files.RegFG_SphAmbResp = [folderByRegion subject ' Sphere Ambiguous Response Tfc.mat'];
Files.RegFG_SphUnambResp = [folderByRegion subject ' Sphere Unambiguous Response Tfc.mat'];
Files.RegFG_SphUnambStim = [folderByRegion subject ' Sphere Unambiguous Stimulus Tfc.mat'];
subject = 'RegJF';
Files.RegJF_FHAmbResp = [folderByRegion subject ' FaceHouse Ambiguous Response Tfc.mat'];
Files.RegJF_FHAmbFResp = [folderByRegion subject ' FaceHouse Ambiguous Face Response Tfc.mat'];
Files.RegJF_FHAmbHResp = [folderByRegion subject ' FaceHouse Ambiguous House Response Tfc.mat'];
Files.RegJF_FHUnambResp = [folderByRegion subject ' FaceHouse Unambiguous Response Tfc.mat'];
Files.RegJF_FHUnambFResp = [folderByRegion subject ' FaceHouse Unambiguous Face Response Tfc.mat'];
Files.RegJF_FHUnambHResp = [folderByRegion subject ' FaceHouse Unambiguous House Response Tfc.mat'];
Files.RegJF_FHUnambStim = [folderByRegion subject ' FaceHouse Unambiguous Stimulus Tfc.mat'];
Files.RegJF_FHUnambFStim = [folderByRegion subject ' FaceHouse Unambiguous Face Stimulus Tfc.mat'];
Files.RegJF_FHUnambHStim = [folderByRegion subject ' FaceHouse Unambiguous House Stimulus Tfc.mat'];
Files.RegJF_SphAmbResp = [folderByRegion subject ' Sphere Ambiguous Response Tfc.mat'];
Files.RegJF_SphUnambResp = [folderByRegion subject ' Sphere Unambiguous Response Tfc.mat'];
Files.RegJF_SphUnambStim = [folderByRegion subject ' Sphere Unambiguous Stimulus Tfc.mat'];
subject = 'RegRV';
Files.RegRV_FHAmbResp = [folderByRegion subject ' FaceHouse Ambiguous Response Tfc.mat'];
Files.RegRV_FHAmbFResp = [folderByRegion subject ' FaceHouse Ambiguous Face Response Tfc.mat'];
Files.RegRV_FHAmbHResp = [folderByRegion subject ' FaceHouse Ambiguous House Response Tfc.mat'];
Files.RegRV_FHUnambResp = [folderByRegion subject ' FaceHouse Unambiguous Response Tfc.mat'];
Files.RegRV_FHUnambFResp = [folderByRegion subject ' FaceHouse Unambiguous Face Response Tfc.mat'];
Files.RegRV_FHUnambHResp = [folderByRegion subject ' FaceHouse Unambiguous House Response Tfc.mat'];
Files.RegRV_FHUnambStim = [folderByRegion subject ' FaceHouse Unambiguous Stimulus Tfc.mat'];
Files.RegRV_FHUnambFStim = [folderByRegion subject ' FaceHouse Unambiguous Face Stimulus Tfc.mat'];
Files.RegRV_FHUnambHStim = [folderByRegion subject ' FaceHouse Unambiguous House Stimulus Tfc.mat'];
Files.RegRV_SphAmbResp = [folderByRegion subject ' Sphere Ambiguous Response Tfc.mat'];
Files.RegRV_SphUnambResp = [folderByRegion subject ' Sphere Unambiguous Response Tfc.mat'];
Files.RegRV_SphUnambStim = [folderByRegion subject ' Sphere Unambiguous Stimulus Tfc.mat'];
end

function Freq = GetFrequencyBins()
Freq.Theta = 1;
Freq.Alpha = 2;
Freq.Beta = 3;
Freq.LowGamma = 4;
Freq.HighGamma = 5;
end

function Colors = GetColors()
Colors.Yellow = [1 1 0];
Colors.Magenta = [1 0 1];
Colors.Cyan = [0 1 1];
Colors.Red = [1 0 0];
Colors.Green = [0 1 0];
Colors.Blue = [0 0 1];
Colors.White = [1 1 1];
Colors.Black = [0 0 0];
end

function LineStyles = GetLineStyles()
LineStyles.Solid = '-';
LineStyles.Dashed = '--';
LineStyles.Dotted = ':';
LineStyles.DashDot = '-.';
end